package com.miyake.dsp.osa.lab.wrapper;

import com.miyake.dsp.ComplexArray;
import com.miyake.dsp.generator.NoiseGenerator;
import com.miyake.dsp.generator.NoiseSetting;
import com.miyake.dsp.osa.lab.Calculator;
import com.miyake.dsp.osa.lab.LabUiAnnotation;

@LabUiAnnotation(caption="Noise Generator")
public class NoiseGeneratorWrapper extends Calculator {
	public static final String INPUT = "Input";
	public static final String OUTPUT = "Output";
	private NoiseSetting setting;
	
	public NoiseGeneratorWrapper(NoiseSetting setting) {
		initInput(INPUT);
		initOutput(OUTPUT);
		this.setting = setting;
	}
	@Override
	public synchronized void process() {
		NoiseGenerator noise = new NoiseGenerator(setting);
		ComplexArray in = this.getInput(INPUT);
		noise.setSource(in);
		ComplexArray ret = noise.getProcessed();
		this.setOutput(OUTPUT, ret);
	}

	@Override
	public Object getSetting() {
		return setting;
	}

}
